﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Reward.master" AutoEventWireup="true" CodeFile="Review.aspx.cs" Inherits="SY.WebSite.Web.Reward.Review" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title><%= CurrentReward.Title%> - 悬赏系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />    
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    
	<link rel="stylesheet" href="<%= Settings.StaticFileDomain %>/Scripts/util/kindeditor/themes/default/default.css" />
	<script charset="utf-8" src="<%= Settings.StaticFileDomain %>/Scripts/util/kindeditor/kindeditor.js" type="text/javascript"></script>
	<script charset="utf-8" src="<%= Settings.StaticFileDomain %>/Scripts/util/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" Runat="Server">
    <div class="row">
        <div class="twelve columns">
            <div class="panel">
                <div class="row">
                    <div class="nine columns">
                        <label class="title"><a href="Detail.aspx?id=<%= CurrentReward.Id %>" title="查看悬赏详细内容" target="_blank"><%= CurrentReward.Title %></a></label>
                    </div>
                    <div class="three columns" style="text-align:right">
                        <label class="inline" style="margin-bottom:3px">悬赏素币：<%= CurrentReward.Amount%></label>
                    </div>
                </div>
                <div>
                    截止时间：<%= CurrentReward.EndTime.ToString("yyyy-MM-dd HH:mm")%>
                </div>
            </div>
        </div>
    </div>
    <dl class="tabs">
        <% if (CurrentReward.Status == 0) { %>
        <dd class=""><a href="javascript:void(0);">未评审</a></dd>
        <% } %>
        <dd class=""><a href="javascript:void(0);">全部创意(<strong><span id="responseCount"><%= CurrentReward.ResponseCount %></span></strong>)</a></dd>
    </dl>
    <%--<div class="alert-box">
        每 5 秒自动保存临时素币授予情况，最终以“结束评审”为准
        <a class="close" title="关闭提醒" href="">×</a>
    </div>--%>
    <div id="result"></div>
    <div id="pagination"></div>
    
    <% if (CurrentReward.Status == 0) { %>
    <div id="secondPanel" class="panel" style="position:fixed; top: 200px; z-index:999999; width: 200px;"> 
        <p>
            可奖励素币：<%= CurrentReward.Amount%><br />
            目前已奖励素币：<span id="tryAmount">0</span>
        </p>        
        <button class="radius alert button" onclick="page.finish()"><% if (CurrentReward.EndTime > DateTime.Now) { %>提前<% }%>结束评审</button>
    </div>
    <% } %>

    <textarea name="transaction" id="transaction" style="display:none;">        
        {for l in list}
            <div class="row">
                <div class="twelve columns">
                    <div class="panel">
                        <div class="row">
                            <div class="eight columns">
                                <label class="title"><strong>@{l.Title}</strong></label>
                                <label>@{l.Amount}</label>
                            </div>
                            <div class="four columns">
                                <label>截止时间：@{l.EndTime.ToDate().Format("yyyy-MM-dd hh:mm")}</label>
                            </div>
                        </div>
                        <div style="word-wrap: break-word;">
                            <p>@{l.Summary}</p>
                        </div>
                        <div>
                            发起人：@{l.UserName}
                        </div>
                    </div>
                </div>
            </div>
        {forelse}
            <div class="row">
                <div class="twelve columns">
                    <div class="panel">
                        暂无相关悬赏
                    </div>
                </div>
            </div>
        {/for}
    </textarea>

    <textarea name="responselist" id="responselist" style="display:none;">        
        {for l in list}
            <div class="row responsePanel">
                <div class="twelve columns">
                    <div class="panel" style="min-height:130px">
                        <div class="row">
                            <div class="nine columns" style="border-right:solid 1px #E6E6E6">
                                <p>@{l.Content.replace(/<\/*script[^>]*>/g, '')}</p>
                                <label style="color:Gray">提交人：<label style="color:Gray">@{l.UserName}</label>提交时间：@{l.CreateTime.ToDate().Format("yyyy-MM-dd hh:mm")}</label>
                            </div>
                            <div class="three columns">
                                {if l.Status == 0}
                                <p>
                                    奖励&nbsp;<input id="amount_@{l.Id}" class="date amount" type="text" style="width:60px" />&nbsp;素币
                                </p>
                                <a class="ignore" href="javascript:void(0)" style="color:gray; text-decoration:underline;" onclick="page.ignore(@{l.Id}, <%= CurrentReward.Id %>, this)">不采纳</a>                            
                                <button class="sure button" style="display:none;" onclick="page.sure(@{l.Id}, <%= CurrentReward.Id %>, this)">采纳</button>                            
                                {else}
                                    <p>{if l.Amount>0}奖赏素币：@{l.Amount}{else}不采纳{/if}</p>
                                {/if}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        {forelse}
            <div class="row">
                <div class="twelve columns">
                    <div class="panel">
                        暂无相关创意
                    </div>
                </div>
            </div>
        {/for}
    </textarea>
    
    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/reward/review.js" type="text/javascript"></script>
    <script type="text/javascript">
        page.id = <%= CurrentReward.Id %>;
        page.pageSize = <%= Math.Max( CurrentReward.ResponseCount,10) %>;
        page.rewardAmount = <%= CurrentReward.Amount %>;
    </script>
</asp:Content>